@extends('layouts.app')

@section('title')
    后台-用户管理-用户列表
@stop

@section('extcss')
    <!--ext css-->
    <style>
        .btn-color {
            color: #93A2B2;
            border: 1px solid rgba(221, 226, 232, 0.49);
        }

        .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th {
            vertical-align: middle;
        }
    </style>
    <!-- /ext css-->
@stop

@section('content')
    <!-- page content -->
    <div class="right_col" role="main">
        <div class="">
            <div class="page-title">
                <div class="title_left">
                    <h3>用户列表</h3>
                </div>

                <div class="title_right">
                    <div class="col-md-5 col-sm-12 form-group pull-right top_search">
                        <div class="input-group">
                            <input type="text" class="form-control" placeholder="查找...">
                                <span class="input-group-btn">
                                  <button class="btn btn-default" type="button"><i class="fa fa-search" title="查找"></i></button>
                                </span>
                        </div>
                    </div>
                    <div class="col-md-7 col-sm-12 form-group pull-right top_search text-right">
                        <a href="{{url('system/user/create')}}" class="btn btn-round btn-default btn-color"
                           type="button" title="新增"><i class="fa fa-plus"></i></a>
                        <button id="btnSelectAll" class="btn btn-round btn-default btn-color" type="button" title="删除" style="display: none;">
                            <i class="fa fa-trash"></i></button>
                        <a href="javascript:window.location.reload();" class="btn btn-round btn-default btn-color"
                           type="button" title="刷新"><i class="fa fa-refresh"></i></a>
                        <button class="btn btn-round btn-default btn-color" type="button" title="下载" style="display: none;"><i
                                    class="fa fa-download"></i></button>
                        <button class="btn btn-round btn-default btn-color" type="button" title="打印" style="display: none;"><i
                                    class="fa fa-print"></i></button>
                    </div>
                </div>
            </div>

            <div class="clearfix"></div>

            <div class="row">
                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <h2>用户表</h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>

                        <div class="x_content">
                            <div class="table-responsive">
                                <table class="table table-striped jambo_table bulk_action">
                                    <thead>
                                    <tr class="headings">
                                        <th>
                                            编号
                                        </th>
                                        <th class="column-title">姓名</th>
                                        <th class="column-title">账户</th>
                                        <th class="column-title">创建时间</th>
                                        <th class="column-title">操作</th>
                                    </tr>
                                    </thead>

                                    <tbody>
                                    @forelse($users as $user)
                                        <tr class="even pointer">
                                            <td class="a-center ">
                                                {{$user->id}}
                                            </td>
                                            <td class=" ">{{$user->name}}</td>
                                            <td class=" ">{{$user->email}}</td>
                                            <td class=" ">{{$user->created_at}}</td>
                                            <td class=" ">
                                                @if($user->isactive==1)
                                                    <button class="btn btn-success btn-md" title="未锁启用用户"><i class="fa fa-unlock fa-1x"></i></button>
                                                @else
                                                    <button class="btn btn-danger btn-md" title="锁定禁止用户"><i class="fa fa-lock fa-1x"></i></button>
                                                @endif
                                            </td>
                                        </tr>
                                    @empty
                                        <tr class="even pointer">
                                            <td class="a-center text-center" colspan="13">
                                                没有查到记录
                                            </td>
                                        </tr>
                                    @endforelse
                                    </tbody>
                                    <tfoot>
                                    　　
                                    <tr>
                                        　　
                                        <td colspan="13">
                                            　　　@if($errors->any())
                                                <ul class="list-group">
                                                    @foreach($errors->all() as $error)
                                                        <li class="list-group-item list-group-item-danger">{{$error}}</li>
                                                    @endforeach
                                                </ul>
                                            @endif
                                        </td>
                                        　　
                                    </tr>
                                    　
                                    </tfoot>
                                </table>
                            </div>
                            <div class="row">
                                <div class="col-md-5 col-xs-12 col-sm-12 col-md-offset-5">{!! $users->links() !!}</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /page content -->
@stop

@section('extjs')
    <!--ext js-->

    <!-- /ext js-->
@stop